# -*- coding: utf-8 -*-
# @File     : api.py
# @Author   : bingjia
# @Time     : 2020/8/6 20:41
# @Desc     : 时间线视图

from ..base.api.viewsets import GenericViewSet

from . import serializers


class TimelineViewSet(GenericViewSet):
    """
    时间线视图
    """
    serializer_class = serializers.TimelineSerializer

    def get_queryset(self):
        ct = self.get_content_type()
        model_cls = ct.model_class()

        qs = model_cls.objects.all()
        filtered_qs = self.filter_queryset(qs)
        return filtered_qs